<?php
namespace app\logic\yuql;


use app\api\model\yuql\Alipay;
use app\services\yuql\PayServices;

class PayLogic
{

    /**
     * yuql
     * model查询订单，调用支付
     * @param $order_id
     * @return \Symfony\Component\HttpFoundation\Response
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getGoodsOrderLogic($order_id){
        if (!$order_id) throw new \Exception('订单为空');
        $result = Alipay::goodsOrderOne(['order_id'=>$order_id]);
        if (!$result) throw new \Exception('订单不存在');
        return (new PayServices())->index($result);
    }

}